#include <stdio.h>
int main(){
    int seconds=0,minutes=0,hours=0;
    scanf("%d",&seconds);
    minutes=seconds/60;
    seconds%=60;
    hours=minutes/60;
    minutes%=60;
    printf("%d %d %d",hours,minutes,seconds);
    return 0;
}